#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

bool isValidSubsequence_2(vector<int> array, vector<int> subsequece)
{
    vector<int> find;
    int ar_index = 0;
    int sub_index = 0;
    while (sub_index < subsequece.size() && ar_index < array.size())
    {
        if (subsequece[sub_index] == array[ar_index])
        {
            find.push_back(subsequece[sub_index]);
            sub_index++;
            continue;
        }

        ar_index++;
    }

    return (subsequece.size() == sub_index);
}